package org.codefinger.json.parser.deserializer;

import java.math.BigInteger;

import org.codefinger.json.parser.JSONArrayDeserializer;
import org.codefinger.json.parser.JSONDeserializer;
import org.codefinger.json.parser.JSONLexer;
import org.codefinger.json.parser.JSONObjectDeserializer;

public class DeserializerForBigInteger implements JSONDeserializer {

	public static final DeserializerForBigInteger	INSTANCE	= new DeserializerForBigInteger();

	private DeserializerForBigInteger() {

	}

	
	@Override
	public Object stringValue(String value) {
		return  new BigInteger(value);
	}

	
	@Override
	public Object stringValue(JSONLexer jsonLexer) {
		return  new BigInteger(jsonLexer.getOriginalString());
	}

	
	@Override
	public Object intValue(String value) {
		return  new BigInteger(value);
	}

	
	@Override
	public Object floatValue(String value) {
		return  new BigInteger(value);
	}

	
	@Override
	public Object falseValue() {
		return  new BigInteger("0");
	}

	
	@Override
	public Object trueValue() {
		return  new BigInteger("1");
	}

	@Override
	public JSONArrayDeserializer createArrayDeserializer() {
		return ArrayDeserializerForNull.INSTANCE;
	}

	@Override
	public JSONObjectDeserializer createObjectDeserializer() {
		return ObjectDeserializerForNull.INSTANCE;
	}

}
